package com.xjoyt.pay.commons;

import java.util.LinkedHashMap;
import java.util.Map;

import com.xjoyt.pay.vo.PayType;

public final class PayTypeUtils {

	private static Map<PayType, String> payMap = null;

	static {
		payMap = new LinkedHashMap<>();
		payMap.put(PayType.WECHAT_SCAN, "微信扫码");
		payMap.put(PayType.ALIPAY_SCAN, "支付宝扫码");
		payMap.put(PayType.BANK_PAY, "网关支付");
		payMap.put(PayType.WECHAT_WAP, "微信wap");
		payMap.put(PayType.ALIPAY_WAP, "支付宝wap");
		payMap.put(PayType.SCANNED_CODE_PAY, "被扫码支付");
		payMap.put(PayType.SCANNED_CODE_PAY, "主动扫码");
		payMap.put(PayType.SCANNED_CODE_ALIPAY, "支付宝主扫");
		payMap.put(PayType.SCANNED_CODE_WECHAT, "微信主扫");
		payMap.put(PayType.WECHAT_PUBLIC, "微信公众号");
	}

	public static Map<PayType, String> getAllPayType() {
		return payMap;
	}

	public static String getName(PayType type) {
		if (type == null) {
			return null;
		}
		return payMap.containsKey(type) ? payMap.get(type) : null;
	}
}
